package org.example.ch01.p03;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNextLine()){
            String s=scanner.nextLine().trim();
            if (s.isEmpty()) continue;
            int sum=0;
            for (int i=0;i<s.length();i++){
                char c=s.charAt(i);
                if (Character.isDigit(c)){
                    sum+=c-'0';
                }
            }
            System.out.println(sum);
        }
        scanner.close();
    }
}
